extends Node

var keys={
	"debug":true,
	"accept":false,
	"cancel":false,
	"quit":false,
	"pause":false,
	"bag":false,
	"run":false,
#	"mouse_x":0,"mouse_y":0,"click":false,
	"up":false,"down":false,"right":false,"left":false,"jump":false
}

var hold_run=false

func _ready():
	pause_mode=Node.PAUSE_MODE_PROCESS

#func _input(event):
#	if event is InputEventMouseButton:
#		keys.click=(event.button_index==BUTTON_LEFT&&event.pressed)

func _process(_delta):
	if(Input.is_action_just_pressed("debug")):
		keys.debug=!keys.debug
	if(Input.is_action_just_pressed("pause")):
		keys.pause=!keys.pause
	if(Input.is_action_just_pressed("hold_run")):
		hold_run=!hold_run
	keys.run=true if hold_run else Input.is_action_pressed("run")
	keys.bag=Input.is_action_just_pressed("bag")
	keys.accept=Input.is_action_just_pressed("ui_accept")
	keys.cancel=Input.is_action_just_pressed("ui_cancel")
	keys.quit=Input.is_action_just_pressed("ui_end")
	keys.up=Input.is_action_pressed("ui_up")
	keys.down=Input.is_action_pressed("ui_down")
	keys.right=Input.is_action_pressed("ui_right")
	keys.left=Input.is_action_pressed("ui_left")
	keys.jump=Input.is_action_pressed("jump")
#	keys.mouse_x=int(get_viewport().get_mouse_position().x)
#	keys.mouse_y=int(get_viewport().get_mouse_position().y)
